﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.DirectX;
using Microsoft.DirectX.Direct3D;
using System.Drawing;

namespace DX.engine
{
    public static class Utility
    {

        public static Model CreateModel_Cube()
        {
            Model cube = new Model();
            int vertexColor = Color.White.ToArgb();
            cube.ModelName = "cube";
            cube.vertices = new CustomVertex.PositionColored[8];
            cube.vertices[0].Position = new Vector3(0f, 0f, 0f);
            cube.vertices[1].Position = new Vector3(0f, 1f, 0f);
            cube.vertices[2].Position = new Vector3(1f, 1f, 0f);
            cube.vertices[3].Position = new Vector3(1f, 0f, 0f);
            cube.vertices[4].Position = new Vector3(0f, 0f, 1f);
            cube.vertices[5].Position = new Vector3(0f, 1f, 1f);
            cube.vertices[6].Position = new Vector3(1f, 1f, 1f);
            cube.vertices[7].Position = new Vector3(1f, 0f, 1f);

            for(int i = 0; i <8; i++)
                cube.vertices[i].Color = vertexColor;
            cube.indices = new short[36] {0,1,2, 2,3,0, 4,5,6, 
                                          6,7,4, 0,3,5, 5,4,0,
                                          3,2,6, 6,5,3, 2,1,7,
                                          7,6,2, 1,0,4, 4,7,1};
            return cube;
        }
    }
}
